package com.itheima;

import javax.lang.model.element.VariableElement;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/xiaomishu")
public class xiaomishu extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        ServletContext context = getServletContext();
        String contextPath = context.getContextPath();
        System.out.println(contextPath);
        System.out.println("___________________________________");
        String realPath = context.getRealPath("download/a.txt");
        System.out.println(realPath);
        System.out.println("___________________________________");
        String servletPath = request.getServletPath();
        System.out.println(servletPath);
        System.out.println("___________________________________");
        String contextPath1 = request.getContextPath();
        System.out.println(contextPath1);


    }
}
